﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Tree;


namespace Forum.Entity.Board
{
    public partial class BoardInfo : TreeInfo
    {
        public override string GetTableName()
        {
            return "f_board";
        }
        public override string GetInsertSql()
        {
            return "insert into f_board ( [ID], [Name], [UpperID], [Path], [Depth], [Orders], [State], [Topics], [Posts], [LastTopicID], [LastTopicName], [LastPostTime], [LastMemberID], [LastMemberName], [NeedApprove], [ApplyTopicType], [Remark], [SeoKeywords], [SeoDescription], [Moderator]) values ( @ID, @Name, @UpperID, @Path, @Depth, @Orders, @State, @Topics, @Posts, @LastTopicID, @LastTopicName, @LastPostTime, @LastMemberID, @LastMemberName, @NeedApprove, @ApplyTopicType, @Remark, @SeoKeywords, @SeoDescription, @Moderator)";
        }
        public override string GetUpdateSql()
        {
            return "update f_board set  [Name] = @Name, [UpperID] = @UpperID, [Path] = @Path, [Depth] = @Depth, [Orders] = @Orders, [State] = @State, [Topics] = @Topics, [Posts] = @Posts, [LastTopicID] = @LastTopicID, [LastTopicName] = @LastTopicName, [LastPostTime] = @LastPostTime, [LastMemberID] = @LastMemberID, [LastMemberName] = @LastMemberName, [NeedApprove] = @NeedApprove, [ApplyTopicType] = @ApplyTopicType, [Remark] = @Remark, [SeoKeywords] = @SeoKeywords, [SeoDescription] = @SeoDescription, [Moderator] = @Moderator where ID = @ID";
        }


        /// <summary>
        /// 版块的状态
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
        /// <summary>
        /// 标题总数
        /// </summary>
        public Int32 Topics
        {
            get;
            set;
        }
        /// <summary>
        /// 帖子总数
        /// </summary>
        public Int32 Posts
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发表的主题ID
        /// </summary>
        public Int32? LastTopicID
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发表的主题
        /// </summary>
        public String LastTopicName
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发贴时间
        /// </summary>
        public DateTime? LastPostTime
        {
            get;
            set;
        }
        /// <summary>
        /// 最后贴人的ID
        /// </summary>
        public Int32? LastMemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发贴的昵称
        /// </summary>
        public String LastMemberName
        {
            get;
            set;
        }
        /// <summary>
        /// 发贴是否需要审核
        /// </summary>
        public Boolean NeedApprove
        {
            get;
            set;
        }
        /// <summary>
        /// 是否应用主题类型
        /// </summary>
        public Boolean ApplyTopicType
        {
            get;
            set;
        }
        /// <summary>
        /// 论坛备注
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        /// <summary>
        /// Seo关键字
        /// </summary>
        public String SeoKeywords
        {
            get;
            set;
        }
        /// <summary>
        /// Seo描述
        /// </summary>
        public String SeoDescription
        {
            get;
            set;
        }
        /// <summary>
        /// 版主
        /// </summary>
        public String Moderator
        {
            get;
            set;
        }

        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "upperid":
                    this.UpperID = (Int32)value;
                    break;
                case "path":
                    this.Path = (String)value;
                    break;
                case "depth":
                    this.Depth = (Int32)value;
                    break;
                case "orders":
                    this.Orders = (Int32)value;
                    break;
                case "state":
                    this.State = (Int32)value;
                    break;
                case "topics":
                    this.Topics = (Int32)value;
                    break;
                case "posts":
                    this.Posts = (Int32)value;
                    break;
                case "lasttopicid":
                    this.LastTopicID = (Int32?)value;
                    break;
                case "lasttopicname":
                    this.LastTopicName = (String)value;
                    break;
                case "lastposttime":
                    this.LastPostTime = (DateTime?)value;
                    break;
                case "lastmemberid":
                    this.LastMemberID = (Int32?)value;
                    break;
                case "lastmembername":
                    this.LastMemberName = (String)value;
                    break;
                case "needapprove":
                    this.NeedApprove = (Boolean)value;
                    break;
                case "applytopictype":
                    this.ApplyTopicType = (Boolean)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
                case "seokeywords":
                    this.SeoKeywords = (String)value;
                    break;
                case "seodescription":
                    this.SeoDescription = (String)value;
                    break;
                case "moderator":
                    this.Moderator = (String)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "upperid":
                    return this.UpperID;
                case "path":
                    return this.Path;
                case "depth":
                    return this.Depth;
                case "orders":
                    return this.Orders;
                case "state":
                    return this.State;
                case "topics":
                    return this.Topics;
                case "posts":
                    return this.Posts;
                case "lasttopicid":
                    return this.LastTopicID;
                case "lasttopicname":
                    return this.LastTopicName;
                case "lastposttime":
                    return this.LastPostTime;
                case "lastmemberid":
                    return this.LastMemberID;
                case "lastmembername":
                    return this.LastMemberName;
                case "needapprove":
                    return this.NeedApprove;
                case "applytopictype":
                    return this.ApplyTopicType;
                case "remark":
                    return this.Remark;
                case "seokeywords":
                    return this.SeoKeywords;
                case "seodescription":
                    return this.SeoDescription;
                case "moderator":
                    return this.Moderator;
                default:
                    return null;
            }
        }

       
      
    }

}
